package com.ansion.commonchat.startup.workmanager.bwork;


import androidx.annotation.NonNull;

import com.ansion.commonchat.startup.workmanager.bwork.utils.taskexecutor.BTaskExecutor;

import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.Executor;


/**
 * Created by wanghongjie on 2023/5/11
 * Describe :  参数类，用于提供有关工作请求和运行环境的信息。
 */
public final class BWorkerParameters {

    private @NonNull
    UUID mId;
    private @NonNull
    BData mInputData;
    private @NonNull
    Set<String> mTags;
    private @NonNull
    Executor mBackgroundExecutor;
    private @NonNull
    BTaskExecutor mWorkTaskExecutor;

    public BWorkerParameters(
            @NonNull UUID id,
            @NonNull BData inputData,
            @NonNull Collection<String> tags,
            @NonNull Executor backgroundExecutor,
            @NonNull BTaskExecutor workTaskExecutor) {
        mId = id;
        mInputData = inputData;
        mTags = new HashSet<>(tags);
        mBackgroundExecutor = backgroundExecutor;
        mWorkTaskExecutor = workTaskExecutor;
    }

    public @NonNull
    UUID getId() {
        return mId;
    }

    public @NonNull
    BData getInputData() {
        return mInputData;
    }

    public @NonNull
    Set<String> getTags() {
        return mTags;
    }

    public @NonNull
    Executor getBackgroundExecutor() {
        return mBackgroundExecutor;
    }

    public @NonNull
    BTaskExecutor getTaskExecutor() {
        return mWorkTaskExecutor;
    }
}